// https://leetcode.cn/problems/pascals-triangle-ii/description/


func getRow(rowIndex int) []int {
    rec := [][]int{}
	rec = append(rec, []int{1})
	for i := 0; i < rowIndex; i++ {
		tmp := make([]int, i + 1)
		tmp[0], tmp[i] = 1, 1
		for j := 1; j < i; j++ {
			tmp[j] = tmp[i - 1][j] + tmp[i - 1][j - 1]
		}
		rec = append(rec, tmp)
	}
	return rec[rowIndex - 1]
}